package manager.entitycreator;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Entity Creator Interface. Classes that implement this interface will override
 * the method for describing how to create a new Entity object from the given
 * ResultSet.
 * 
 * @author mohameds.2012, sheryl.tay
 * 
 * @param <T>
 *            the type of entity that may be created by this entity creator
 */
public interface EntityCreator<T> {

	/**
	 * Returns a new entity object of type T with information extracted from the
	 * given ResultSet.
	 * 
	 * @param rs
	 *            result set containing information pertaining to the T entity
	 * @return a new T entity object with information extracted from the
	 *         ResultSet
	 * @throws SQLException
	 */
	public T newEntityFromResultSet(ResultSet rs) throws SQLException;

}
